This invention relates to the field of messaging systems and message validation. In particular, the invention relates to message type validation.
Strong typing is used to describe situations where programming languages specify the type of a destination up-front, and enable checking and optimization by the software platform that a software application uses.
Messaging systems often do not have strong typing and rely on the producer and consumer of a message having an implicit understanding of the types of messages that are being conveyed.
The Java Message Service (JMS) specification (Java is a trademark of Sun Microsystems, Inc.) provides for a selector associated with a message consumer, which filters out messages at message receipt time, Messages are only delivered to a consumer if they pass the selector's test. However, no such check is made when the message is sent, so the message producer is unaware of this filtering.
It is also known in some messaging systems to assert that messages published on a particular topic must conform to a particular schema, for example, WebSphere topics (WebSphere is a trademark of International Business Machines Corporation).
Code generation is also used to do type checking. A piece of code (sometimes referred to as a stub) is generated and linked into a sending application. This piece of code is responsible for generating the message on behalf of the sending application of a correct type. The disadvantage of code generation is that, if the type definition changes, then either all the stubs have to be regenerated and relinked with all the senders, or the system has to recognize that there are multiple levels of stubs deployed and perform a fix after the message has been sent.